package com.train.${module}.req;

<#list typeSet as type>
<#if type=='LocalDate'>
import java.time.LocalDate;
<#elseif type=='LocalTime'>
import java.time.LocalTime;
<#elseif type=='LocalDatetime'>
import java.time.LocalDateTime;
</#if>
<#if type=='BigDecimal'>
import java.math.BigDecimal;
</#if>
</#list>

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.train.common.group.AddGroup;
import com.train.common.group.EditGroup;

/**
 * ${Domain}AddOrEditReq
 * @author ${author}
 * @createDate ${date}
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ${Domain}AddOrEditReq {

    <#list fieldList as field>
    <#if field.nameHump != "createTime" && field.nameHump != "updateTime">

    /**
     * ${field.comment}
     */
        <#if field.name == "id">
    @NotNull(message = "【${field.nameCn}】不能为空", groups = {EditGroup.class})
        </#if>
    <#if field.name!="id" && field.nameHump!="createdAt" && field.nameHump!="updatedAt">
        <#if !field.nullAble>
            <#if field.javaType=='String'>
    @NotBlank(message = "【${field.nameCn}】不能为空", groups = {AddGroup.class, EditGroup.class})
            <#else>
    @NotNull(message = "【${field.nameCn}】不能为空", groups = {AddGroup.class, EditGroup.class})
            </#if>
        </#if>
    </#if>
    private ${field.javaType} ${field.nameHump};
    </#if>
    </#list>
}
